﻿@using Atomic.Themes;

@model Atomic.Plugins.Users.Domain.Admin.AuthorizeRoleModel

@{
    ViewBag.Title = "授权 - 角色管理";
}

角色名称：@this.Model.Role.DisplayName

<form action="/admin/user/role/authorize/@this.Model.Role.Id" method="post">
    <table>
        <thead>
            <tr>
                <td>编号</td>
                <td>唯一名称</td>
                <td>显示名称</td>
                <td>描述</td>
                <td><input type="checkbox" /></td>
            </tr>
        </thead>
        <tbody>
            @if (this.Model.Permissions != null && this.Model.Permissions.Count() > 0)
            {
                foreach (var permission in this.Model.Permissions)
                {
                    string check = this.Model.Role.IsAuthorize(permission) ? "checked=\"checked\"" : string.Empty;
                    <text>
                        <tr>
                            <td>@permission.Id</td>
                            <td>@permission.Name</td>
                            <td>@permission.DisplayName</td>
                            <td>@permission.Description</td>
                            <td><input type="checkbox" name="Permissions" value="@permission.Id" @check/></td>
                        </tr>
                    </text>
                }
            }

        </tbody>
    </table>
    @Html.Hidden("role.Id", this.Model.Role.Id)
    <input type="submit" value="保存" />
</form>
<a href="/admin/user/role/list/1">返回</a>